import { Router, Route, Switch, Redirect } from 'react-router-dom'
import Layout from './pages/Layout'
import Login from './pages/Login'
import NotFound from './pages/NotFount'
import history from './utils/history'
import PrivateRoute from './components/PrivateRoute'
export default function App() {
  return (
    <Router history={history}>
      <div className="App">
        <Switch>
          {/* <Redirect exact from="/" to="/home"></Redirect> */}
          <Route
            exact
            path="/"
            render={() => <Redirect to="/home"></Redirect>}
          ></Route>
          <Route path="/login" component={Login}></Route>
          {/* <Route path="/home" component={Layout}></Route> */}
          <PrivateRoute path="/home" component={Layout}></PrivateRoute>
          <Route path="/404" component={NotFound}></Route>
        </Switch>
      </div>
    </Router>
  )
}
